<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增批次')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-bacth-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">批次名：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="batchName" id="batchName" required>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    function submitHandler(){
        if($.validate.form()){
            add();
        }
    }

    function add(){
        var batchName = $("input[name='batchName']").val();
        $.ajax({
            cache: true,
            type: "POST",
            url: ctx + "boxItembacth/insert",
            data: {
                "batchName": batchName
            },
            async: false,
            error: function(request){
                $.modal.alertError("系统错误");
            },
            success: function(data){
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>